package com.etc;



import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class User implements Writable {
    private String coding;
    private String userId;
    private String name;
    private int age;
    private String star;
    private String logo;

    public User() {
    }

    public User(String coding, String userId, String name, int age, String star, String logo) {
        this.coding = coding;
        this.userId = userId;
        this.name = name;
        this.age = age;
        this.star = star;
        this.logo = logo;
    }

    public String getCoding() {
        return coding;
    }

    public void setCoding(String coding) {
        this.coding = coding;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getStar() {
        return star;
    }

    public void setStar(String star) {
        this.star = star;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    @Override
    public String toString() {
        return  this.coding + "," +this.userId + "," + this.name + "," +this.age + "," +this.star;
    }

    @Override
    public void write(DataOutput out) throws IOException {
        out.writeUTF(coding);
        out.writeUTF(userId);
        out.writeUTF(name);
        out.writeInt(age);
        out.writeUTF(star);
        out.writeUTF(logo);
    }

    @Override
    public void readFields(DataInput in) throws IOException {
        this.coding = in.readUTF();
        this.userId = in.readUTF();
        this.name = in.readUTF();
        this.age = in.readInt();
        this.star = in.readUTF();
        this.logo = in.readUTF();
    }

}
